package scene.shape.geometry;

import raytracing.HitRecord;
import raytracing.Ray;
import scene.shape.BoundingBox;
import scene.shape.Hittable;
import scene.shape.Shape;
import util.Vector3f;

public abstract class Primitive implements Hittable{
	
	protected Shape shape;
	
	public abstract HitRecord intersects(Ray r, float mint, float maxt);
	
	public abstract BoundingBox getBoundingBox();
	
	public void setShape(Shape s){
		this.shape = s;
	}

	public abstract float getU(HitRecord hr);
	public abstract float getV(HitRecord hr);

	public Shape getShape() {
		return shape;
	}

	public Vector3f getCenter() {
		return getBoundingBox().getCenter();
	}
	
	
}
